package com.changcheng.project.yuminsi.enums;

/**
 * @author yuminsi
 * @description
 * @date 2020/8/21 10:38
 * @since
 */
public enum VehicleType {
    /**
     * 客一
     */
    BUS1("客一","01"),
    /**
     *客二
     */
    BUS2("客二","02"),
    /**
     *客三
     */
    BUS3("客三","03"),
    /**
     *客四
     */
    BUS4("客四","04"),
    /**
     *货一
     */
    TRUCK1("货一","11"),
    /**
     *货二
     */
    TRUCK2("货二","12"),
    /**
     *货三
     */
    TRUCK3("货三","13"),
    /**
     *货四
     */
    TRUCK4("货四","14"),
    /**
     *货五
     */
    TRUCK5("货五","15"),
    /**
     *货六
     */
    TRUCK6("货六","16");

    private String name;
    private String code;

    VehicleType() {
    }

    VehicleType(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static VehicleType getVehicleType(String code){
        for (VehicleType vehicleType : values()){
            if (vehicleType.getCode().equals(code)){
                return vehicleType;
            }
        }
        return null;
    }
}
